﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.ComponentModel;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public partial class TSZL05
    {
        public TSZL05()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VAMEINST();
            DataContext = MV;
            InitializeComponent();
        }

        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
             if(dwMain==null)
            { }
            if(dwMaster==null)
            {
                BDEKEN = "";
            }
            else
            {
                BDEKEN = TMV.AMEBDEKEN;
            }
        }
        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            if (IsLoaded)
                return;
            base.Window_Loaded(sender, e);
            LOADZL05();
        }
        public void LOADZL05()
        {
            dwData = TMV.TBMain.NewRow();
            //+ " WHERE AMEMANDANT=:AMEMANDANT: AND AMENRKRS=:AMENRKRS: AND AMELFDNR=:AMELFDNR: AND AMEPOS=:AMEPOS: AND AMEMODNR=:AMEMODNR: AND AMEEINSTNR=:AMEEINSTNR: ";
            dwData["AMEMANDANT"] = app.Mandant;
            dwData["AMEBEZ"] = "AND AMART LIKE 'ZLAN%'";
            SResult = TMV.QAME05(dwData);
            MergeData(SResult, false);
        }
        public override void LOADBYAUF()
        {
            Locate("KEY", ORDERNUM);
            base.LOADBYAUF();
        } 
        
    }

}
